
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dawutech" content="dwdoor">
<title>智慧园区信息管理系统</title>

<link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="/js/jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/js/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<!--<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>-->
<script type="text/javascript" src="/js/jquery-cookie.js"></script>
<script type="text/javascript">
	$(function(){
		// 数据
		var treeData=[
			{
			text:"园区信息管理",
			children:
				[
					{
						text:"出入园区人员信息管理",
						attributes:
						{
							url:"/web/ReaderInfoManage.php"
						}
					},
					{
						text:"出入园区记录查询",
						attributes:
						{
							url:"/web/VisitRecordQuery.php"
						} 
					}
/*					, 
					{
						text:"出入园区信息统计",
						attributes:
						{
							url:"VisitRecordStat.jsp"
						}
					},
					{
						text:"出入园区人员排行榜",
						attributes:
						{
							url:"VisitorRank.jsp"
						}
					},  
					{
						text:"黑名单人员信息管理",
						attributes:
						{
							url:"BlacklistpersonInfoManage.jsp"
						}
					},
					{ 
						text:"人像对比记录查询", 
						attributes: 
						{ 
							url:"Visitrecordsimilaritysearch.jsp"
						} 
					}*/					
				]
			},
			{
				text:"维护信息管理",
				children:
					[
/*						{
							text:"登录人员信息管理",
							attributes:
							{
								url:"UserInfoManage.jsp"
							}
						},*/
						{
							text:"门信息管理",
							attributes:
							{
								url:"/web/GateInfoManage.php"
							}
						}
					]
			}
			];
		
		// 实例化树菜单
		$("#tree").tree({
			data:treeData,
			lines:true,
			onClick:function(node){
				if(node.attributes){
					openTab(node.text,node.attributes.url);
				}
			}
		});
		
		// 新增Tab
		function openTab(text,url)
		{
			if($("#tabs").tabs('exists',text))
			{
				$("#tabs").tabs('select',text);
			}else
			{
				var content="<iframe frameborder='0' scrolling='auto' style='width:100%;height:100%' src="+url+"></iframe>";
				$("#tabs").tabs('add',{
					title:text,
					closable:true,
					content:content
				});
			}
		}
		
		
	});
	
	$(document).ready(function()
    {    	
		$(function()
		{
	//		console.log(document.cookie);
	//		console.log($.cookie('logon'));
			var a = $.cookie('logon');
			if(a === "null" || !a)
			{
				console.log("go to login.php");
			    top.window.location.pathname = '/login.php';
			} 	
		});
		
	    $('.exit').on('click',function()
		{
	            $.cookie('logon',null,{path:"/"}); 
				top.window.location.pathname = '/login.php';
	            return true;

	    });
	});

	function checkCookie()
	{
	  	var a = $.cookie('logon') === "null" || !$.cookie('logon');
///		var a = $.cookie('logon');
	  	if(a)
	  	{
	  		top.window.location.pathname = '/login.php';
	  	}else
	  	{
		    var date = new Date();
		    date.setTime(date.getTime() + (60 * 60 * 1000));
		    $.cookie('logon',true,{expires: date, path:"/"});		 
		}
//		alert('logon');
	}
	function onInit()
	{
//		$("#dwusername").text('当前用户：&nbsp;<font color="red" >'+$.cookie('dwusername')+'</font>');
		$("#dwusername").text('当前用户：'+$.cookie('dwusername'));
		checkCookie();
//		alert('logon');
//		alert($.cookie('dwusername'));
	}
</script>
</head>
<body onLoad="onInit();" class="easyui-layout">
	<div region="north" style="height: 80px;background-color: #E0EDFF" >
		<div align="left" style="width: 75%;float: left">
			<div align="center" style="padding-top: 8px;"><font color="#423A3A" size="7">智慧园区信息管理系统</font></div>
		</div>
		
		<div id="dwusername" style="padding-top: 50px;padding-right: 20px;"></div>
	</div>
	<div region="center" >
		<div class="easyui-tabs" fit="true" border="false" id="tabs">
			<div title="首页" align="center" >
			
				<table width="1024" height="680" background="images/libray.jpg">  

			    </table>
			</div>
		</div>
	</div>
	<div region="west" style="width: 180px;" title="导航菜单" split="true">
		<ul id="tree"></ul>
	</div>
	<div region="south" style="height: 25px;" align="center">版权所有@</div>
</body>
</html>